<?php

class PanBookService{
	
    public static function save115Book($link,$name,$author){
        $cnt = PanBookAR::model()->count('download_url=?',array($link));
        if($cnt>0){
            return;
        }
        $ar = new PanBookAR;
        if($author == ''){
            $ar->name=$name;
        }else{
            $ar->name='['.$author.']'.$name;
        }
        $ar->author=$author;
        $ar->download_url=$link;
        $ar->fatch_code='';
        $ar->fk_user=User::id();
        $ar->username=User::name();
        $ar->status=1;
        $ar->save();
    }
	
}
